package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.DoctorConsultationQuery;
import com.mk.admin.model.vo.DoctorConsultationVo;
import com.mk.admin.service.DoctorConsultationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/doctorConsultation")
@Api(tags = "医生线上问诊")
public class DoctorConsultationController {
    @Autowired
    private DoctorConsultationService doctorConsultationService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody DoctorConsultationQuery query) {
        return doctorConsultationService.select(query);
    }

    @PostMapping("/last")
    @ApiOperation("最近咨询")
    public ResultDto last(@RequestBody DoctorConsultationQuery query) {
        return doctorConsultationService.last(query);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody DoctorConsultationVo vo) {
        return doctorConsultationService.add(vo);
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody DoctorConsultationVo vo) {
        return doctorConsultationService.update(vo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody DoctorConsultationVo vo) {
        return doctorConsultationService.delete(vo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody DoctorConsultationVo vo) {
        return doctorConsultationService.status(vo.getId());
    }

}
